import { menuList } from '@/api/menu.js'
export default {
  namespaced: true,
  state: {
    navTree: '',
    collapse: false,
  },
  mutations: {
    setNavTree(state, data) {
      state.navTree = data
    },
    setCollapse(state, data) {
      state.collapse = data
    },
  },
  actions: {
    async getMenuList({ commit }, menuType = 1) {
      const { data } = await menuList({ menuType })

      commit('setNavTree', data)
      return data
    },
  },
}
